package com.hp.sso.connet;

import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider;
import org.springframework.social.oauth2.OAuth2Template;

import com.hp.sso.api.QQAPIInterface;
import com.hp.sso.api.impl.QQAPIInterfaceImpl;

public class QQServiceProcide extends AbstractOAuth2ServiceProvider<QQAPIInterface>{

	private String appId;
	
	public static final String URL_AUTH="https://graph.qq.com/oauth2.0/authorize";
	
	public static final String URL_ACCESS_TOKEN="https://graph.qq.com/oauth2.0/token";
	
	public QQServiceProcide(String appId,String appSecret) {
		super(new OAuth2Template(appId, appSecret, URL_AUTH, URL_ACCESS_TOKEN));
	}

	@Override
	public QQAPIInterface getApi(String accessToken) {
		return new QQAPIInterfaceImpl(accessToken, appId);
	}

}
